from functools import partial


def calc_income_tax(tax_point,income):
    """
    计税函数
    :param tax_point: 起征点
    :param income: 实际收入
    :return:
    """
    return (income-tax_point)*0.1

#税收起征点是固定的，每个人计算都要传入5000起征点太麻烦，希望只传入收入
tax_jack = calc_income_tax(5000,12000)
print(tax_jack)

calc_income_tax_5k =  partial(calc_income_tax,5000)
print(calc_income_tax_5k) #functools.partial(<function calc_income_tax at 0x000002707E90F040>, 5000)
tax_jack = calc_income_tax_5k(12000)
print(tax_jack)